package cn.edu.xmu.orderpayment.payment.model.bo;

import cn.edu.xmu.orderpayment.payment.model.vo.SimpleAdminUser;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;

@NoArgsConstructor
@AllArgsConstructor
@Data
public class PaymentPattern {
    /**
     * 支付单渠道状态
     */
    /**
     * 支付单渠道状态
     */
    public enum State{
        VALID((byte)0 ,"渠道可用"),
        INVALID((byte)1,"渠道不可用");

        private static final Map<Byte, PaymentPattern.State> stateMap;
        static {
            stateMap = new HashMap();
            for (PaymentPattern.State enum1 : values()) {
                stateMap.put(enum1.code, enum1);
            }
        }

        private Byte code;
        private String description;
        State(Byte code, String description) {
            this.code = code;
            this.description = description;
        }


        public Byte getCode() {
            return this.code;
        }

        public String getDescription() {
            return this.description;
        }

        public PaymentPattern.State getDescriptionByCode(Byte code){
            return stateMap.get(code);
        }
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Byte getState() {
        return state;
    }

    public void setState(Byte state) {
        this.state = state;
    }

    public LocalDateTime getBeginTime() {
        return beginTime;
    }

    public void setBeginTime(LocalDateTime beginTime) {
        this.beginTime = beginTime;
    }

    public LocalDateTime getEndTime() {
        return endTime;
    }

    public void setEndTime(LocalDateTime endTime) {
        this.endTime = endTime;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public SimpleAdminUser getCreator() {
        return creator;
    }

    public void setCreator(SimpleAdminUser creator) {
        this.creator = creator;
    }

    public SimpleAdminUser getModifier() {
        return modifier;
    }

    public void setModifier(SimpleAdminUser modifier) {
        this.modifier = modifier;
    }

    public LocalDateTime getGmtCreate() {
        return gmtCreate;
    }

    public void setGmtCreate(LocalDateTime gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    public LocalDateTime getGmtModified() {
        return gmtModified;
    }

    public void setGmtModified(LocalDateTime gmtModified) {
        this.gmtModified = gmtModified;
    }


    private Long id;
    private String name;
    private Byte state;
    private LocalDateTime beginTime;
    private LocalDateTime endTime;
    private String className;
    private SimpleAdminUser creator;
    private SimpleAdminUser modifier;
    private LocalDateTime gmtCreate;
    private LocalDateTime gmtModified;
}
